package com.wyp.design.pattern.structural.decorator.v1;

/**
 * 使用继承完成对对象功能的拓展，发现拓展是有限的，当顾客想要两个鸡蛋加一个肠的时候，有需要去写一个继承类，很有可能导致类爆炸
 * @author: Oliver
 * @time: 2020/5/9/12:09
 */
public class Test {
    public static void main(String[] args) {
        BatterCake battercake = new BatterCake();
        System.out.println(battercake.getDesc() + " 销售价格:" + battercake.cost());

        BatterCake battercakeWithEgg = new BatterCakeWithEgg();
        System.out.println(battercakeWithEgg.getDesc() + " 销售价格:" + battercakeWithEgg.cost());


        BatterCake battercakeWithEggSausage = new BatterCakeWithEggSausage();
        System.out.println(battercakeWithEggSausage.getDesc() + " 销售价格:" + battercakeWithEggSausage.cost());
    }
}
